package cn.jiyun.service;

import cn.jiyun.dao.UserDao;
import cn.jiyun.pojo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceimpl implements UserService {
    @Resource
    private UserDao userDao;
    @Override
    public User findById(Long id) {
        return userDao.selectById(id);
    }

    @Override
    public List<User> all() {
        return userDao.selectList(null);
    }

    @Override
    public void del(Long id) {
        userDao.deleteById(id);
    }

    @Override
    public void add(User user) {
        userDao.insert(user);
    }
}
